package org.alys114.springcloud.pmember.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 *@author: Vincent.chan
 *@date: 2019/10/1 4:14
 *@version: v1.0
 *@Description: Feign客户端
 */

/*
* pbook是service-id
* @FeignClient(name = "pbook") 指明BookClient是pbook微服务的客户端
*/
@FeignClient(name = "pbook")
public interface BookClient {

    /* @GetMapping("/info")表示当调用getInfo时，会向 book微服务的/info 发送请求
     * @RequestParam("bid")表示url上自动增加?bid=xxx
    */
    @GetMapping("/info")
    RestResult getInfo(@RequestParam("bid") Integer bid);

    @PostMapping("/create")
    String create(@RequestBody Map rec);
}
